package com.photohistory.hibernate.beans;
// Generated 31.03.2010 12:15:52 by Hibernate Tools 3.2.4.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Country generated by hbm2java
 */
@Entity
@Table(name="country"
    ,catalog="mytest"
)
public class Country  implements java.io.Serializable {


     private Integer id;
     private Language language;
     private String name;
     private Set<Town> towns = new HashSet<Town>(0);
     private Set<NaturalPhoto> naturalPhotos = new HashSet<NaturalPhoto>(0);
     private Set<City> cities = new HashSet<City>(0);

    public Country() {
    }

	
    public Country(Language language, String name) {
        this.language = language;
        this.name = name;
    }
    public Country(Language language, String name, Set<Town> towns, Set<NaturalPhoto> naturalPhotos, Set<City> cities) {
       this.language = language;
       this.name = name;
       this.towns = towns;
       this.naturalPhotos = naturalPhotos;
       this.cities = cities;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="language_id", nullable=false)
    public Language getLanguage() {
        return this.language;
    }
    
    public void setLanguage(Language language) {
        this.language = language;
    }

    
    @Column(name="name", nullable=false, length=40)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="country")
    public Set<Town> getTowns() {
        return this.towns;
    }
    
    public void setTowns(Set<Town> towns) {
        this.towns = towns;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="country")
    public Set<NaturalPhoto> getNaturalPhotos() {
        return this.naturalPhotos;
    }
    
    public void setNaturalPhotos(Set<NaturalPhoto> naturalPhotos) {
        this.naturalPhotos = naturalPhotos;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="country")
    public Set<City> getCities() {
        return this.cities;
    }
    
    public void setCities(Set<City> cities) {
        this.cities = cities;
    }

    public String toString(){
    	return name;
    }


}


